package com.sky.context;

public class BaseContext {

    //线程变量
    public static ThreadLocal<Long> threadLocal = new ThreadLocal<>();

    //设置当前用户id
    public static void setCurrentId(Long id) {
        threadLocal.set(id);
    }

    //获取当前用户id
    public static Long getCurrentId() {
        return threadLocal.get();
    }

    //移除当前用户id
    public static void removeCurrentId() {
        threadLocal.remove();
    }

}
